home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 48 / Amiga Format CD48 (1999-12-13)(Future Publishing)(GB)(Track 1 of 2)[!][issue 2000-01].iso / -websites- / whdload / games / invest.lha / InvestHD / Install_Coverdisk < prev    next >
Text File  |  1999-07-05  |  4KB  |  197 lines

  1. ;****************************
  2.  
  3. (set #readme-file "Invest.readme") ;name of readme file
  4. (set #last-disk 1)          ;amount of disks
  5. (set #disk-size1 901120)     ;size of game disk
  6. (set #disk-size2 135168)     ;size of save disk
  7.  
  8. ;****************************
  9. ;----------------------------
  10. ; Checks if given program is reachable via the path
  11. ; if not abort install
  12. ; IN:  #program - to check
  13. ; OUT: -
  14.  
  15. (procedure P_chkrun
  16.   (if
  17.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  18.     ("")
  19.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  20.   )
  21. )
  22.  
  23. ;----------------------------
  24. ; Create disk-Image using DIC
  25. ; IN:  #dest        - DestinationPath
  26. ;      #CI_diskname - DiskName
  27. ;      #CI_diskno   - DiskNumber
  28. ;      #CI_drive    - DriveToReadFrom
  29. ; OUT: -
  30.  
  31. (procedure P_image1
  32.   (message ("\nInsert Invest disk into drive \n\n(make sure it's the right disk because it will not checked)" #CI_diskname #CI_drive))
  33.   (if
  34.     (= 0 
  35.       (run ("cd \"%s\"\nDIC %s FD=%ld LD=%ld SIZE=%ld >CON:///1000//CLOSE" #dest #CI_drive 1 1 #disk-size1))
  36.     )
  37.     ("")
  38.     (abort "\"DIC\" has failed to create a diskimage")
  39.   )
  40. )
  41.  
  42. (procedure P_image2
  43.   (message ("\nInsert Invest savegame disk or any other DOS formatted disk"))
  44.   (if
  45.     (= 0 
  46.       (run ("cd \"%s\"\nDIC %s FD=%ld LD=%ld SIZE=%ld >CON:///1000//CLOSE" #dest #CI_drive 3 3 #disk-size2))
  47.     )
  48.     ("")
  49.     (abort "\"DIC\" has failed to create a diskimage")
  50.   )
  51. )
  52.  
  53. (message ("\nWelcome in Invest installation utility\nfor Amiga Spiele version\n\nPlease use other install script\nif you want to install original 2-disk-version."))
  54.  
  55. (if
  56.   (exists #readme-file)
  57.   (if
  58.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  59.     ("")
  60.     (run ("SYS:Utilities/More %s" #readme-file))
  61.   )
  62. )
  63.  
  64. (set #program "WHDLoad")
  65. (P_chkrun)
  66.  
  67. (set #program "DIC")
  68. (P_chkrun)
  69.  
  70. ; in expert mode ask for source drive
  71. (if
  72.   (= @user-level 2)
  73.   (
  74.     (set #CI_drive
  75.       (askchoice
  76.     (prompt "Select source drive for diskimages")
  77.     (default 0)
  78.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  79.     (help @askchoice-help)
  80.       )
  81.     )
  82.     (select #CI_drive
  83.       (set #CI_drive "DF0:")
  84.       (set #CI_drive "DF1:")
  85.       (set #CI_drive "RAD:")
  86.       (set #CI_drive
  87.         (askstring
  88.           (prompt "Select source drive for diskimages")
  89.           (default "DF0:")
  90.           (help @askstring-help)
  91.         )
  92.       )
  93.     )
  94.   )
  95.   (set #CI_drive "DF0:")
  96. )
  97.  
  98. (set @default-dest
  99.   (askdir
  100.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  101.     (help @askdir-help)
  102.     (default @default-dest)
  103.     (disk)
  104.   )
  105. )
  106. (set #dest (tackon @default-dest @app-name))
  107. (if
  108.   (exists #dest)
  109.   (
  110.     (set #choice
  111.       (askbool
  112.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  113.         (default 1)
  114.         (choices "Delete" "Skip")
  115.         (help @askbool-help)
  116.       )
  117.     )
  118.     (if
  119.       (= #choice 1)
  120.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  121.     )
  122.   )
  123. )
  124. (makedir #dest
  125.   (help @makedir-help)
  126.   (infos)
  127. )
  128.  
  129. ;----------------------------
  130.  
  131. (copyfiles
  132.   (help @copyfiles-help)
  133.   (source ("%s.slave" @app-name))
  134.   (dest #dest)
  135. )
  136. (if
  137.   (exists ("%s.newicon" @app-name))
  138.   (set #icon
  139.     (askchoice
  140.       (prompt "\nWhich icon do you like to install ?\n")
  141.       (default 0)
  142.       (choices "Normal" "NewIcon")
  143.       (help @askchoice-help)
  144.     )
  145.   )
  146.   (set #icon 0)
  147. )
  148. (select #icon
  149.   (set #icon ("%s.inf" @app-name))
  150.   (set #icon ("%s.newicon" @app-name))
  151. )
  152. (copyfiles
  153.   (help @copyfiles-help)
  154.   (source #icon)
  155.   (newname ("%s.info" @app-name))
  156.   (dest #dest)
  157. )
  158. (if
  159.   (exists #readme-file)
  160.   (copyfiles
  161.     (help @copyfiles-help)
  162.     (source #readme-file)
  163.     (dest #dest)
  164.     (infos)
  165.   )
  166. )
  167.  
  168. (copyfiles
  169.   (help @copyfiles-help)
  170.   (source "OSEmu.400")
  171.   (dest #dest)
  172. )
  173. (if
  174.   (exists ("%s.info" #readme-file))
  175.   (copyfiles
  176.     (help @copyfiles-help)
  177.     (source ("%s.info" #readme-file))
  178.     (dest #dest)
  179.   )
  180. )
  181.  
  182. (set #CI_diskno 1)
  183. (while
  184.   (<= #CI_diskno #last-disk)
  185.   (
  186.     (set #CI_diskname ("%s Disk %ld" @app-name #CI_diskno))
  187.     (P_image1)
  188.     (P_image2)
  189.     (run ("FileNote Disk.%ld %s Quiet" #CI_diskno @app-name))
  190.     (set #CI_diskno (+ #CI_diskno 1))
  191.   )
  192. )
  193.  
  194. ;----------------------------
  195.  
  196. (exit)
  197.